//
//  ViewController.m
//  UI24_加密
//
//  Created by dllo on 16/8/16.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "ViewController.h"
#import "NSString+YHMD5.h"
#import "NSString+YHSHA_1.h"
#import "NSString+YHBase64.h"
#import "NSString+YHDES.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSString *str = @"zhao";
    NSString *str1 = [str stringWith16BitMD5Upper];
    NSLog(@"16BIT大写: %@", str1);
    NSString *str2 = [str stringWith16BitMD5Lower];
    NSLog(@"16BIT小写: %@", str2);
    NSString *str3 = [str stringWith32BitMD5Upper];
    NSLog(@"32BIT大写: %@", str3);
    NSString *str4 = [str stringWith32BitMD5Lower];
    NSLog(@"32BIT小写: %@", str4);
    
    NSString *str5 = [str stringWithSHA_1];
    NSLog(@"SHA_1: %@", str5);
    

    NSString *str6 = [str stringWithBase64];
    NSLog(@"base64Str: %@", str6);
    NSString *str7 = [str6 base64WithString];
    NSLog(@"转为原来的字符串: %@", str7);
    
    // 对称加密
    // 1. DES 2. 三重DES 3.AES
    NSString *str8 = @"12777777777777773";
    NSString *str9 = [str8 stringWithDES];
    NSLog(@"DES加密: %@", str9);
    NSString *str10 = [str9 DESWithString];
    NSLog(@"DES解密: %@", str10);
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
